﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using HR.ProjectX.Models.Entities.Vehicles;
using HR.ProjectX.Models.Entities.Customers;

namespace HR.ProjectX.Models.Entities.Vehicles
{
    public class Vehicle : EntityBase<int>, IAggregateRoot
    {
        public virtual Manufacturer Manufacturer { get; set; }
        public virtual Model Model { get; set; }
        public virtual VehicleCategory VehicleCategory { get; set; }
        public virtual string RegistrationNumber { get; set; }
        public virtual int CurrentKilometers { get; set; }
        public virtual float DailyHireRate { get; set; }

        protected override void Validate()
        {
            if (string.IsNullOrEmpty(RegistrationNumber))
            {
                base.AddBrokenRule(CustomerBusinessRules.CustomerEmailRequired);
            }
        }
    }
}
